<?php  
 // session_start();

      if(!empty($_POST)){
          
         
// implode(glue, pieces)
         
         // ‘ ，’分隔符
         $_POST['power'] = implode(',',$_POST['power']);

         // print_r($_POST);die;

             $_rows = add('role',$_POST);

            //如果$_rows>0说明成功
            if ($_rows>0) {
                echo '<script> alert ("新闻数据添加成功");location.href="index.php?c=role&a=list&admin=1";</script>';die;
                   
            }else{

                echo '<script> alert ("新闻数据添加失败");history.go(-1);</script>';
                    die;
            }


            }
          $parent = getSelect('power','pid=0');
          $child = getSelect('power','pid!=0');

          // print_r($child) ;die;

            //链接news.html的语句
            include (VIEW_PATH.$admin.'/layout.html');

            ?>

